<!doctype html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Integration with dhtmlxMenu</title>

	<script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css" media="screen" title="no title"
	      charset="utf-8">

	<link rel="stylesheet" type="text/css" href="../common/dhtmlxMenu/skins/dhtmlxmenu_dhx_terrace.css">
	<script src="../common/dhtmlxMenu/dhtmlxmenu.js"></script>


	<style type="text/css" media="screen">
		html, body {
			margin: 0px;
			padding: 0px;
			height: 100%;
			overflow: hidden;
		}
	</style>

	<script type="text/javascript" charset="utf-8">
		function init() {
			scheduler.config.multi_day = true;
			scheduler.config.first_hour = 8;
			scheduler.config.limit_time_select = true;

			scheduler.config.xml_date = "%Y-%m-%d %H:%i";
			scheduler.init('scheduler_here', new Date(2009, 7, 10), "week");
			scheduler.load("./data/events.xml");



			var menu = new dhtmlXMenuObject();
			menu.setSkin("dhx_terrace");
			menu.setIconsPath("./data/imgs/");
			menu.renderAsContextMenu();
			menu.loadXML("./data/dhxmenu.xml?e=" + new Date().getTime());

			scheduler.attachEvent("onContextMenu", function(event_id, native_event_object) {
				if (event_id) {
					var posx = 0;
					var posy = 0;
					if (native_event_object.pageX || native_event_object.pageY) {
						posx = native_event_object.pageX;
						posy = native_event_object.pageY;
					} else if (native_event_object.clientX || native_event_object.clientY) {
						posx = native_event_object.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
						posy = native_event_object.clientY + document.body.scrollTop + document.documentElement.scrollTop;
					}
					menu.showContextMenu(posx, posy);
					return false; // prevent default action and propagation
				}
				return true;
			});

			dhtmlx.message("Right-click on event to see the menu");
		}
	</script>
</head>
<body onload="init();">
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
	<div class="dhx_cal_navline">
		<div class="dhx_cal_prev_button">&nbsp;</div>
		<div class="dhx_cal_next_button">&nbsp;</div>
		<div class="dhx_cal_today_button"></div>
		<div class="dhx_cal_date"></div>
		<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
		<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
		<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
	</div>
	<div class="dhx_cal_header">
	</div>
	<div class="dhx_cal_data">
	</div>
</div>
</body>
